﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Spinning.Spinning.Entity
{
    class MovableTextEntity : TextEntity
    {
        public int Time //持續時間
        {
            get;
            set;
        }

        public Vector2 Path
        {
            get;
            set;
        }

        int _gameTime;
        protected override void UpdateSelf(Microsoft.Xna.Framework.GameTime gameTime)
        {
            base.UpdateSelf(gameTime);
            int delta = gameTime.ElapsedGameTime.Milliseconds;
            _gameTime += delta;
            if (_gameTime / 1000 >= 1)
            {
                _gameTime = _gameTime % 1000;
                Time--;
                if (Time == 0) { Alpha = 0; }
            }

            Position = new Vector2(Position.X + Path.X / (33 * Time), Position.Y + Path.Y / (33 * Time));
        }
    }
}
